package com.weslide.weslideapp.activity;

import com.weslide.weslideapp.R;
import com.weslide.weslideapp.fragment.GoodsDetailFragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;

public class GiftDetailActivity extends WeSlideActivity {
	public static final String TAG = "GiftDetailActivity";
	public static final String EXTRA_GOODID = "goodId";
	private String goodId;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.activity_giftdetail);
		goodId = getIntent().getStringExtra(EXTRA_GOODID);
		FragmentTransaction transaction = getSupportFragmentManager()
				.beginTransaction();
		GoodsDetailFragment goodsDetailFragment = new GoodsDetailFragment();
		Bundle bundle = new Bundle();
		bundle.putString(EXTRA_GOODID, goodId);
		goodsDetailFragment.setArguments(bundle);
		transaction.add(R.id.activity_Contaner, goodsDetailFragment);
		transaction.commit();
	}

	@Override
	public void onBackPressed() {
		// super.onBackPressed();
		Intent intent = new Intent();
		intent.setClass(this, MainActivity_de.class);
		intent.putExtra(MainActivity_de.EXTRA_IS_USERCENTER, false);
		intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(intent);
		finish();
	}

}
